import yaml

from autoTest_brtcApi.utils.get_path import get_yaml_path
def write_yaml(filename,content):
    with open(get_yaml_path(filename),'w',encoding='utf-8') as f:
        # 将数据写入yaml文件
        yaml.safe_dump(content,f,default_flow_style=False,allow_unicode=True)


if __name__ == "__main__":
    content = {"userId":"1234568511",
               "token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdXRob3NfaWQiOiIxMDAwMyIsInVzZXJfbmFtZSI6IjExOTExOTExOSIsInBhc3Nfd29yZCI6ImUxMGFkYzM5NDliYTU5YWJiZTU2ZTA1N2YyMGY4ODNlIiwiZXhwIjoxNzM1OTExOTcxLjQ3NjA3NzYsImlhdCI6MTczNTkxMTk2OC40NzYwODQ1fQ.hkV7S0rYGALw8NKyIsgU-S0WpRpLQL0-rRcN3I383No"}
    write_yaml('tmp.yaml',content)